package com.yaodian100.crm.activities.entity;

import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

import com.yaodian100.core.common.entity.CommonEntity;

/**
 * @author yanling.wu
 * 
 */
@Entity
@Table(name = "CRM_ACTIVITIES")
public class Activities extends CommonEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String id;
	// 用户名
	private String userName;
	// 手机号
	private String mobileNo;

	private Map<String, ActivitiesValue> atValue;

	/**
	 * @return the atValue
	 */
	@org.hibernate.annotations.MapKey(columns = { @Column(name = "name") })
	@OneToMany(mappedBy = "activities")
	@CollectionOfElements(targetElement = ActivitiesValue.class)
	@LazyCollection(LazyCollectionOption.FALSE)
	public Map<String, ActivitiesValue> getAtValue() {
		return atValue;
	}

	/**
	 * @param atValue the atValue to set
	 */
	public void setAtValue(Map<String, ActivitiesValue> atValue) {
		this.atValue = atValue;
	}

	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(length = 32)
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the userName
	 */
	@Column(length = 4000)
	public String getUserName() {
		return userName;
	}

	/**
	 * @param userName the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * @return the mobileNo
	 */
	public String getMobileNo() {
		return mobileNo;
	}

	/**
	 * @param mobileNo the mobileNo to set
	 */
	public void setMobileNo(String mobileNo) {
		this.mobileNo = mobileNo;
	}

}
